package com.anpy.management.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 任务实体类
 */
@Data
@TableName(value = "T_TASK")
@ApiModel(description = "任务信息")
public class TaskEntity {

    @TableId(value = "task_id", type = IdType.AUTO)
    @ApiModelProperty(value = "任务ID", example = "1")
    private Integer taskId;

    @TableField(value = "user_id")
    @ApiModelProperty(value = "用户ID", example = "1")
    private Long userId;
    @TableField(value = "parent_id")
    @ApiModelProperty(value = "父类id", example = "1")
    private Long parentId;
    @TableField(value = "project_id")
    @ApiModelProperty(value = "项目ID", example = "1")
    private Integer projectId;

    @TableField(value = "project_name")
    @ApiModelProperty(value = "项目名称", example = "个人管理系统")
    private String projectName;

    @TableField(value = "task_name")
    @ApiModelProperty(value = "任务名称", example = "实现用户登录功能")
    private String taskName;

    @TableField(value = "task_detail")
    @ApiModelProperty(value = "任务详情", example = "实现用户登录、注册和密码重置功能")
    private String taskDetail;

    @TableField(value = "start_time")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "开始时间", example = "2025-02-27 15:00:00")
    private Date startTime;

    @TableField(value = "end_time")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "结束时间", example = "2025-03-27 15:00:00")
    private Date endTime;

    @TableField(value = "current_status")
    @ApiModelProperty(value = "当前状态", example = "IN_PROGRESS")
    private String currentStatus;

    @TableField(value = "branch")
    @ApiModelProperty(value = "分支", example = "feature/user-login")
    private String branch;

    @TableField(value = "progress")
    @ApiModelProperty(value = "进度", example = "75")
    private Integer progress;

    @TableField(value = "product_manager")
    @ApiModelProperty(value = "产品负责人", example = "张三")
    private String productManager;

    @TableField(value = "test_manager")
    @ApiModelProperty(value = "测试负责人", example = "李四")
    private String testManager;

    @TableField(value = "related_resources")
    @ApiModelProperty(value = "相关资料", example = "https://example.com/docs/login-design.pdf")
    private String relatedResources;

    @TableField(value = "created_at")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间", example = "2025-02-27 15:00:00")
    private Date createdAt;

    @TableField(value = "updated_at")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新时间", example = "2025-02-27 15:00:00")
    private Date updatedAt;
}
